x86: avoid needless EPT table ajustment and cache flush
authorLiang Li <liang.z.li@intel.com>
Thu, 5 Feb 2015 12:59:48 +0000 (13:59 +0100)
committerJan Beulich <jbeulich@suse.com>
Thu, 5 Feb 2015 12:59:48 +0000 (13:59 +0100)
commit06ed8cc2cc9be465719ac8f8def03a43e34064da
treee733e51d590e12e197b6a50d6be7a753020e483d
parente8bb583bec290a4f903cf065814af33ce49d4d0b
x86: avoid needless EPT table ajustment and cache flush

When a guest change it's MTRR MSRs, ajusting EPT table and flushing
cache are needed only when guest has IOMMU device, using need_iommu(d)
can minimize the impact to guest with device assigned, since a guest
may be hot plugged with a device thus there may be dirty cache lines
before need_iommu(d) becoming true, force the p2m_memory_type_changed
and flush_all when the first device is assigned to guest to amend this
issue.

Signed-off-by: Liang Li <liang.z.li@intel.com>
Signed-off-by: Yang Zhang <yang.z.zhang@intel.com>
Acked-by: Kevin Tian <kevin.tian@intel.com>
xen/arch/x86/hvm/mtrr.c
xen/drivers/passthrough/pci.c